﻿using System;
using System.Collections.Generic;

using System.Text;
using System.Windows.Controls;

namespace Bixas.Tangibilis.Controls
{
    public class TouchListBoxItemAdapter : TouchUIElementAdapter<TouchListBoxItem>
    {
        public TouchListBoxItemAdapter(TouchListBoxItem elementAdapted)
            : base(elementAdapted)
        { }

        public override void OnTouchCursorDown(System.Windows.RoutedEventArgs e)
        {
           if (this.TouchElement.Focus())
            {
               TouchListBox parent = ItemsControl.ItemsControlFromItemContainer(this.TouchElement) as TouchListBox;
                if (parent != null)
                {
                    parent.NotifyTouchListItemSelected(this.TouchElement);
                }
            }
            base.OnTouchCursorDown(e);
        }

    }
}
